#ifndef FACIALTRACK_H
#define FACIALTRACK_H

#include "global.h"

#include <QAbstractAnimation>
#include <actiontrack.h>
#include <robot.h>

/**
 * @brief Animates the facial expressions of the robot.
 *
 */
class RobotFacialTrack : public QAbstractAnimation, public RobotActionTrack
{
    Q_OBJECT

private:
    typedef struct facialExpression{
        int timestamp;
        QString filename;
    } FacialExpression;

    int _curKeyFrame;
    Robot* _model;
    QMap<int, FacialExpression> _keyFrames;

public:
    explicit RobotFacialTrack(Robot* robot, QObject *parent = 0);

    void setRobot(Robot* robot);

    void setDuration(int msec);

    void setExpressionAt(int msec, QString filename);
    void setStartExpression(QString filename);
    void setEndExpression(QString filename);
    void deleteExpression(int msec);
    void moveExpression(int msec, int newMsec);

    FacialExpressionInfo expressionAt(int msec) const;
    QList<FacialExpressionInfo> facialInformation() const;

protected:
    void updateCurrentTime(int msec);
    int duration() const;

signals:
    void expressionChanged(int msec);

public slots:

};

#endif // FACIALTRACK_H
